<template>
	<div class="main">
		<h2>主要内容</h2>
		<ul>
			<li v-for="good in dataList" :key="good.id" @click="handleClick(good.id)">{{good.text}}</li>
		</ul>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				dataList: [{
						id: "001",
						text: "商品1"
					},
					{
						id: "002",
						text: "商品2"
					},
					{
						id: "003",
						text: "商品3"
					},
				]
			}
		},
		methods: {
			handleClick(id) {
				console.log(id);
				// location.href = "/detail?id="+id 
				this.$router.history.push("/detail?id="+id)
			}
		}
	}
</script>

<style>
</style>
